<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>家长信息表管理</title>
	<meta name="decorator" content="default" />
	<script type="text/javascript">
        $(document).ready(function() {
            // 表格排序
            var orderBy = $("#orderBy").val().split(" ");
            $("#contentTable th.sort").each(function(){
                if ($(this).hasClass(orderBy[0])){
                    orderBy[1] = orderBy[1]&&orderBy[1].toUpperCase()=="DESC"?"down":"up";
                    $(this).html($(this).html()+" <i class=\"icon icon-arrow-"+orderBy[1]+"\"></i>");
                }
            });
            $("#contentTable th.sort").click(function(){
                var order = $(this).attr("class").split(" ");
                var sort = $("#orderBy").val().split(" ");
                for(var i=0; i<order.length; i++){
                    if (order[i] == "sort"){order = order[i+1]; break;}
                }
                if (order == sort[0]){
                    sort = (sort[1]&&sort[1].toUpperCase()=="DESC"?"ASC":"DESC");
                    $("#orderBy").val(order+" DESC"!=order+" "+sort?"":order+" "+sort);
                }else{
                    $("#orderBy").val(order+" ASC");
                }
                page();
            });
        });
        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }
        $(function(){
            $("td").css("vertical-align","middle");
        })
	</script>
</head>
<body>
<ul class="nav nav-tabs">
	<li class="active"><a href="${ctx}/business/parent/">家长信息表列表</a></li>
	<shiro:hasPermission name="business:parent:edit">
		<li><a href="${ctx}/business/parent/form?sort=10">家长信息表添加</a></li>
	</shiro:hasPermission>
</ul>
<form:form id="searchForm" modelAttribute="parent"
		   action="${ctx}/business/parent/" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}" />
	<input id="orderBy" name="orderBy" type="hidden" value="${page.orderBy}"/>
	<label>名称  ：</label>
	<form:input path="name" htmlEscape="false" maxlength="50"
				class="input-medium" />
	&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit"
	value="查询" />
</form:form>
<tags:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th class="sort id"></th>
		<th class="sort name">家长姓名</th>
		<th class="sort password">性别</th>
		<th class="sort phone">联系电话</th>
		<th class="sort level">学期号</th>
		<th class="sort source">微信名</th>

		<th>备注</th>
		<shiro:hasPermission name="business:parent:edit">
			<th>操作</th>
		</shiro:hasPermission>
	</tr>
	</thead>
	<tbody>
	<c:forEach items="${page.list}" var="parent">
		<tr>
			<td>${parent.id}</td>
			<td>${parent.name}</td>
			<td>${dic:getDictLabel(parent.sex,"sys_sex" ,"未知" ) }</td>
			<td>${parent.phone}</td>
			<td>${parent.semester.number}</td>
			<td>${parent.weChatUser.nickName}</td>
			<td>${parent.remarks}</td>
			<shiro:hasPermission name="business:parent:edit">
				<td><a href="${ctx}/business/parent/form?id=${parent.id}">修改</a>
					<a href="${ctx}/business/parent/delete?id=${parent.id}" onclick="return confirmx('确认要删除该字典吗？', this.href)">删除</a>
				</td>
			</shiro:hasPermission>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>